package com.dizner.diassistant.dataentry

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import com.bin.david.form.annotation.SmartColumn
import com.bin.david.form.annotation.SmartTable

@SmartTable(name="血压记录")
@Entity(tableName = "blood_pressure_history")
class BloodPressureHistoryEntry {

    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "_id")
    var id: Int = 0
    @SmartColumn(id =1,name = "高压(mm/hg)")
    @ColumnInfo(name = "higher")
    var higherValue: Int = 0
    @SmartColumn(id =2,name = "低压(mm/hg)")
    @ColumnInfo(name = "lower")
    var lowerValue: Int = 0
    @SmartColumn(id =3,name = "心率(bpm)")
    @ColumnInfo(name = "heart_rate")
    var heartRate: Int = 0
    @SmartColumn(id =4,name = "采集时间")
    @ColumnInfo(name = "createTime")
    var createTime: String = ""

    @Ignore/*过滤到room框架用不到的构造器*/
    constructor(higherValue: Int, lowerValue: Int, heartRate: Int, createTime: String) {
        this.higherValue = higherValue
        this.lowerValue = lowerValue
        this.heartRate = heartRate
        this.createTime = createTime
    }

    constructor()

    override fun toString(): String {
        return "BloodPressureHistoryEntry(id=$id, higherValue=$higherValue, lowerValue=$lowerValue, createTime='$createTime')"
    }


}